<?php
/**
 * SocialEngine
 *
 * @category   Application_Extensions
 * @package    Sitepage
 * @copyright  Copyright 2010-2011 BigStep Technologies Pvt. Ltd.
 * @license    http://www.socialengineaddons.com/license/
 * @version    $Id: homesponsored.tpl 2011-05-05 9:40:21Z SocialEngineAddOns $
 * @author     SocialEngineAddOns
 */
?>
<?php if ($this->direction == 1) { ?>
  <?php foreach ($this->sitepagesitepage as $sitepage): ?>
    <div class="SlideItMoo_element sitepage_sponsor_sitepage">
      <div class="sitepage_sponsor_thumb">
        <?php echo $this->htmlLink(Engine_Api::_()->sitepage()->getHref($sitepage->page_id, $sitepage->owner_id, $sitepage->getSlug()), $this->itemPhoto($sitepage, 'thumb.icon', $sitepage->getTitle()), array('rel' => 'lightbox[galerie]', 'class' => "")) ?>
      </div>
      <div class="sitepage_sponsor_sitepage_info">
        <div class="sitepage_sponsor_sitepage_title">
          <?php echo $this->htmlLink(Engine_Api::_()->sitepage()->getHref($sitepage->page_id, $sitepage->owner_id, $sitepage->getSlug()), Engine_Api::_()->sitepage()->truncation($sitepage->getTitle(), Engine_Api::_()->getApi('settings', 'core')->getSetting('sitepage.title.truncationsponsored', 18)), array('title' => $sitepage->getTitle())) ?>
        </div>       
        <div class="sitepage_sponsor_sitepage_details">
          <?php echo $this->translate('posted by'); ?>
          <?php echo $this->htmlLink($sitepage->getOwner()->getHref(), Engine_Api::_()->sitepage()->truncation($sitepage->getOwner()->getTitle(), 10), array('title' => $sitepage->getOwner()->getTitle())) ?>
        </div>
      </div>
    </div>	 
  <?php endforeach; ?>
<?php } else { ?>
  <?php $count = Engine_Api::_()->getApi('settings', 'core')->getSetting('sitepage.sponserdsitepage.widgets', 4); ?>
  <?php for ($i = $count; $i < $this->count; $i++): ?>
    <div class="SlideItMoo_element sitepage_sponsor_sitepage">
      <div class="sitepage_sponsor_thumb">
        <?php echo $this->htmlLink(Engine_Api::_()->sitepage()->getHref($this->sitepagesitepage[$i]->page_id, $this->sitepagesitepage[$i]->owner_id, $this->sitepagesitepage[$i]->getSlug()), $this->itemPhoto($this->sitepagesitepage[$i], 'thumb.icon', $this->sitepagesitepage[$i]->getTitle()), array('rel' => 'lightbox[galerie]', 'class' => "")) ?>
      </div>
      <div class="sitepage_sponsor_sitepage_info">
        <div class="sitepage_sponsor_sitepage_title">
          <?php echo $this->htmlLink(Engine_Api::_()->sitepage()->getHref($this->sitepagesitepage[$i]->page_id, $this->sitepagesitepage[$i]->owner_id, $this->sitepagesitepage[$i]->getSlug()), Engine_Api::_()->sitepage()->truncation($this->sitepagesitepage[$i]->getTitle(), Engine_Api::_()->getApi('settings', 'core')->getSetting('sitepage.title.truncationsponsored', 18)), array('title' => $this->sitepagesitepage[$i]->getTitle())) ?>
        </div>      
        <div class="sitepage_sponsor_sitepage_details">
          <?php echo $this->translate('posted by'); ?>
          <?php echo $this->htmlLink($this->sitepagesitepage[$i]->getOwner()->getHref(), Engine_Api::_()->sitepage()->truncation($this->sitepagesitepage[$i]->getOwner()->getTitle(), 10), array('title' => $this->sitepagesitepage[$i]->getOwner()->getTitle())) ?>
        </div>
      </div>
    </div>	 
  <?php endfor; ?>
  <?php for ($i = 0; $i < $count; $i++): ?>
    <div class="SlideItMoo_element sitepage_sponsor_sitepage">
      <div class="sitepage_sponsor_thumb">
        <?php echo $this->htmlLink(Engine_Api::_()->sitepage()->getHref($this->sitepagesitepage[$i]->page_id, $this->sitepagesitepage[$i]->owner_id, $this->sitepagesitepage[$i]->getSlug()), $this->itemPhoto($this->sitepagesitepage[$i], 'thumb.icon', $this->sitepagesitepage[$i]->getTitle()), array('rel' => 'lightbox[galerie]', 'class' => "")) ?>
      </div>
      <div class="sitepage_sponsor_sitepage_info">
        <div class="sitepage_sponsor_sitepage_title">
          <?php echo $this->htmlLink(Engine_Api::_()->sitepage()->getHref($this->sitepagesitepage[$i]->page_id, $this->sitepagesitepage[$i]->owner_id, $this->sitepagesitepage[$i]->getSlug()), Engine_Api::_()->sitepage()->truncation($this->sitepagesitepage[$i]->getTitle(), Engine_Api::_()->getApi('settings', 'core')->getSetting('sitepage.title.truncationsponsored', 18)), array('title' => $this->sitepagesitepage[$i]->getTitle())) ?>
        </div>      
        <div class="sitepage_sponsor_sitepage_details">
          <?php echo $this->translate('posted by'); ?>
          <?php echo $this->htmlLink($this->sitepagesitepage[$i]->getOwner()->getHref(), Engine_Api::_()->sitepage()->truncation($this->sitepagesitepage[$i]->getOwner()->getTitle(), 10), array('title' => $this->sitepagesitepage[$i]->getOwner()->getTitle())) ?>
        </div>
      </div>
    </div>
  <?php endfor; ?>
<?php } ?>